import java.text.DecimalFormat;

public class Student {
    String studentID;
    String name;
    int chineseScore;
    int mathScore;
    int englishScore;

    public Student(String studentID, String name, int chineseScore, int mathScore, int englishScore) {
        this.studentID = studentID;
        this.name = name;
        this.chineseScore = chineseScore;
        this.mathScore = mathScore;
        this.englishScore = englishScore;
    }

    public String getStudentID() {
        return studentID;
    }

    public void setStudentID(String studentID) {
        this.studentID = studentID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getChineseScore() {
        return chineseScore;
    }

    public void setChineseScore(int chineseScore) {
        this.chineseScore = chineseScore;
    }

    public int getMathScore() {
        return mathScore;
    }

    public void setMathScore(int mathScore) {
        this.mathScore = mathScore;
    }

    public int getEnglishScore() {
        return englishScore;
    }

    public void setEnglishScore(int englishScore) {
        this.englishScore = englishScore;
    }

    public int hashCode() {
        return chineseScore + mathScore + englishScore;
    }

    public String formatString() {
        int totalScore = chineseScore + mathScore + englishScore;
        double averageScore = totalScore / 3.0;
        DecimalFormat format = new DecimalFormat("#.0");
        String str = format.format(averageScore);
        averageScore = Double.parseDouble(str);
        return studentID + "," + name + "," + chineseScore + "," + mathScore + "," + englishScore + "," + totalScore + "," + averageScore+"\n";
    }
}
